package com.java.sjzl.util;

import com.github.javafaker.Faker;
import com.java.sjzl.vo.UserExportVO;

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

public class CommonUtil {

    public static List<Object> generateDummyData(int totalRecords) {
        List<Object> userList = new ArrayList<>();
        Faker faker = new Faker(Locale.CHINA);

        for (int i = 1; i <= totalRecords; i++) {
            UserExportVO user = new UserExportVO();
            user.setRealName(faker.name().fullName());
            user.setSex(faker.number().numberBetween(1, 2));
            user.setBirthday(faker.date().birthday());
            user.setPhone(faker.phoneNumber().cellPhone());
            user.setTel(faker.phoneNumber().phoneNumber());
            user.setEmail(faker.internet().emailAddress());
            user.setAvatar(faker.internet().avatar());

            userList.add(user);
        }
        return userList;
    }
}
